import request from '@/utils/request'

export default {
  getRoleList(searchModel) {
    return request({
      url: '/role/list',
      method: 'get',
      params: {
        pageNow: searchModel.pageNow,
        pageSize: searchModel.pageSize,
        roleDesc: searchModel.roleDesc,

      }
    });
  },
  updateRoleById(editRole){
    return request({
      url: '/role',
      method: 'put',
      params: {
        "id":editRole.id,
        "roleName" : editRole.roleName,
        "roleDesc ": editRole.roleDesc,
      }
    });
  },
  addRole(editRole){
    return request({
      url: '/role/add',
      method: 'post',
      data:{
        roleName:editRole.roleName,
        roleDesc:editRole.roleDesc
      }
    });
  },
  removeRoleById(id){
    return request({
      url: `/role/${id}`,
      method: 'delete',
    });
  },
  getAllrole(){
    return request({
      url: `/role/all`,
      method: 'get',
    });
  }

} 